import greenfoot.*;  // (World, Actor, GreenfootImage, Greenfoot and MouseInfo)

/**
 * Abstract Superclass for all Obstacles.
 * 
 * @author (Thomas KOBER) 
 * @author (Dilyan GEORGIEV)
 * 
 * @version (1.0)
 */
public abstract class Obstacle extends Actor
{
    /**
     * Act - do whatever the Obstacle wants to do. This method is called whenever
     * the 'Act' or 'Run' button gets pressed in the environment.
     */
    public void act() 
    {}
    
    /**
     * Returns the coordinate of the right side of the obstacle.
     * @return the coordinate of the right side of the obstacle.
     */
    public int rightSide()    {
        return super.getX() + ( super.getImage().getWidth()/2 );
    }
    
    /**
     * Returns the coordinate of the left side of the obstacle.
     * @return the coordinate of the left side of the obstacle.
     */
    public int leftSide() {
        return super.getX() - ( super.getImage().getWidth()/2 );
    }
    
    /**
     * Returns the coordinate of the top side of the obstacle.
     * @return the coordinate of the top side of the obstacle.
     */
    public int topSide()   {
        return super.getY() - ( super.getImage().getHeight()/2 );
    }
    
    /**
     * Returns the coordinate of the bottom side of the obstacle.
     * @return the coordinate of the bottom side of the obstacle.
     */
    public int bottomSide()    {
        return super.getY() + ( super.getImage().getHeight()/2 );
    }
}
